package com.sztle.admodule.control.input;

import androidx.annotation.Keep;

import com.google.gson.Gson;

@Keep
public class SzInEventParam {
    public String eventName;
    public String logType = "0";//日志类型0-行为,1-广告
    public long time;
    public String data = "{}";

    //行为日志
    public SzInEventParam(String eventName) {
        this.eventName = eventName;
        this.logType = "0";
        this.data = "";
        time = System.currentTimeMillis();
    }

    public SzInEventParam(String eventName, String logType, String param) {
        this.eventName = eventName;
        this.logType = logType;
        this.data = param;
        time = System.currentTimeMillis();
    }

    public SzInEventParam(String eventName, String logType, Object object) {
        Gson gson = new Gson();
        this.eventName = eventName;
        this.logType = logType;
        if (object != null) {
            this.data = gson.toJson(object);
        } else {
            this.data = "";
        }
        time = System.currentTimeMillis();
    }

    @Override
    public String toString() {
        return "SzInAppLogParam{" +
                "eventName='" + eventName + '\'' +
                ", logType='" + logType + '\'' +
                ", time=" + time +
                ", data='" + data + '\'' +
                '}';
    }
}
